#include "main.h"
#include "Global.h"

void SetupFonts(Fonts* _Fonts){
	_Fonts->Courier20=new CText(g_pD3DDevice, "Courier", 20, false, false);
	_Fonts->Courier20B=new CText(g_pD3DDevice, "Courier", 20, true, false);
	_Fonts->Courier12=new CText(g_pD3DDevice, "Courier", 12, false, false);
	_Fonts->Courier12B=new CText(g_pD3DDevice, "Courier", 12, true, false);
	_Fonts->Arial20=new CText(g_pD3DDevice, "Arial", 20, false, false);
	_Fonts->Arial20B=new CText(g_pD3DDevice, "Arial", 20, true, false);
	_Fonts->Arial12=new CText(g_pD3DDevice, "Arial", 12, false, false);
	_Fonts->Arial12B=new CText(g_pD3DDevice, "Arial", 12, true, false);
}
void SetupSprites(Sprites* _Sprites){
	/*---------------------------------------------------------------------------------------------------------------------------------
	-Initialize
	---------------------------------------------------------------------------------------------------------------------------------*/
	D3DXCreateSprite(g_pD3DDevice,&g_pDrawSprite);
	D3DXCreateLine(g_pD3DDevice, &g_pDrawLine);

	_Sprites->Char = new Characters();
	_Sprites->Char->ME = new Character();
	_Sprites->Char->Yellow = new Character();

	_Sprites->Weapon = new Weapons();
	_Sprites->Bg = new Bgs();
	_Sprites->HUD = new HUDSprites();
	_Sprites->Vehicle = new Vehicles();
	_Sprites->Level = new LevelDesign();
	_Sprites->Misc = new Miscs();
	/*---------------------------------------------------------------------------------------------------------------------------------
	-Characters
	---------------------------------------------------------------------------------------------------------------------------------*/

	//ME
	_Sprites->Char->ME->Eyes = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->ME->Mouth = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->ME->Torso = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_torso_32.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),1,0);
	_Sprites->Char->ME->Feet = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_feet_32.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),1,0);
	_Sprites->Char->ME->JetPack = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->ME->FullHead = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	//Yellow
	_Sprites->Char->Yellow->Eyes = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/Yellow/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->Yellow->Mouth = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/Yellow/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->Yellow->Feet = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/Yellow/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->Yellow->Torso = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/ME/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->Yellow->JetPack = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/Yellow/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);
	_Sprites->Char->Yellow->FullHead = new CSprite(g_pD3DDevice, "Resources/Sprites/Characters/Yellow/me_head_64.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),2,0);

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Weapons
	---------------------------------------------------------------------------------------------------------------------------------*/

	//Assult Rifle
	_Sprites->Weapon->AssaultRifle = new CSprite(g_pD3DDevice, "Resources/Sprites/Weapons/Assault Rifle/gun_assult.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),1,0);
	//Shotgun
	//_Sprites->Weapon->Shotgun = new CSprite(g_pD3DDevice, "Resources/Sprites/Weapons/Shogun/shotgun.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);
	//RocketLauncher
	//_Sprites->Weapon->RocketLauncher = new CSprite(g_pD3DDevice, "Resources/Sprites/Weapons/Rocket Launcher/launcher.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);
	//_Sprites->Weapon->Rocket = new CSprite(g_pD3DDevice, "Resources/Sprites/Weapons/Rocket Launcher/rocket.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Backgrounds
	---------------------------------------------------------------------------------------------------------------------------------*/

	_Sprites->Bg->City1 = new CSprite(g_pD3DDevice, "Resources/Sprites/Level Design/City/bg_city1.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);

	/*---------------------------------------------------------------------------------------------------------------------------------
	-HUD
	---------------------------------------------------------------------------------------------------------------------------------*/

	//Crosshair
	_Sprites->HUD->Crosshair = new CSprite(g_pD3DDevice, "Resources/Sprites/HUD/crosshair.png", D3DXVECTOR3(255.0f,255.0f,255.0f),0,0);

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Vehicles
	---------------------------------------------------------------------------------------------------------------------------------*/

	//_Sprites->Vehicle->Helicopter = new CSprite(g_pD3DDevice, "Resources/Sprites/Vehicles/Helicopter/helicopter.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Level Design
	---------------------------------------------------------------------------------------------------------------------------------*/

	_Sprites->Level->Sidewalk1 = new CSprite(g_pD3DDevice, "Resources/Sprites/Level Design/City/sidewalk1.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);
	_Sprites->Level->TSBuilding1 = new CSprite(g_pD3DDevice, "Resources/Sprites/Level Design/City/ts_building1.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),4,4,0);
	//_Sprites->Level->Brick1 = new CSprite(g_pD3DDevice, "Resources/Sprites/Level Design/City/brick1.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Misc
	---------------------------------------------------------------------------------------------------------------------------------*/

	_Sprites->Misc->Console = new CSprite(g_pD3DDevice, "Resources/Sprites/Misc/console.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);
	_Sprites->Misc->Rect = new CSprite(g_pD3DDevice, "Resources/Sprites/Misc/rect.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);
	_Sprites->Misc->CursorDefault = new CSprite(g_pD3DDevice, "Resources/Sprites/Misc/cursor_default.PNG", D3DXVECTOR3(111.0f,49.0f,152.0f),0,0);
}

void CleanupFonts(Fonts* _Fonts){
	delete _Fonts->Courier20;
	delete _Fonts->Courier20B;
	delete _Fonts->Courier12;
	delete _Fonts->Courier12B;
	delete _Fonts->Arial20;
	delete _Fonts->Arial20B;
	delete _Fonts->Arial12;
	delete _Fonts->Arial12B;
}

void CleanupSprites(Sprites* _Sprites){
	g_pDrawSprite->Release();
	g_pDrawLine->Release();
	/*---------------------------------------------------------------------------------------------------------------------------------
	-Characters
	---------------------------------------------------------------------------------------------------------------------------------*/

	//ME
	delete _Sprites->Char->ME->Eyes;
	delete _Sprites->Char->ME->Mouth;
	delete _Sprites->Char->ME->Feet;
	delete _Sprites->Char->ME->Torso;
	delete _Sprites->Char->ME->JetPack;
	delete _Sprites->Char->ME->FullHead;
	//Yellow
	delete _Sprites->Char->Yellow->Eyes;
	delete _Sprites->Char->Yellow->Mouth;
	delete _Sprites->Char->Yellow->Feet;
	delete _Sprites->Char->Yellow->Torso;
	delete _Sprites->Char->Yellow->JetPack;
	delete _Sprites->Char->Yellow->FullHead;

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Weapons
	---------------------------------------------------------------------------------------------------------------------------------*/

	//Assult Rifle
	delete _Sprites->Weapon->AssaultRifle;
	//Shotgun
	//delete _Sprites->Weapon->Shotgun;
	//RocketLauncher
	//delete _Sprites->Weapon->RocketLauncher;
	//delete _Sprites->Weapon->Rocket;

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Backgrounds
	---------------------------------------------------------------------------------------------------------------------------------*/

	delete _Sprites->Bg->City1;

	/*---------------------------------------------------------------------------------------------------------------------------------
	-HUD
	---------------------------------------------------------------------------------------------------------------------------------*/

	//Crosshair
	delete _Sprites->HUD->Crosshair;

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Vehicles
	---------------------------------------------------------------------------------------------------------------------------------*/

	//delete _Sprites->Vehicle->Helicopter;

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Level Design
	---------------------------------------------------------------------------------------------------------------------------------*/

	delete _Sprites->Level->Sidewalk1;
	delete _Sprites->Level->TSBuilding1;
	//delete _Sprites->Level->Brick1;

	/*---------------------------------------------------------------------------------------------------------------------------------
	-Misc
	---------------------------------------------------------------------------------------------------------------------------------*/

	delete _Sprites->Misc->Console;
	delete _Sprites->Misc->Rect;
	delete _Sprites->Misc->CursorDefault;
}